It can be compiled normally, but the error "Java. Lang. noclassdeffounderror: ORG/jaxen/jaxenexception" is reported during running.
After some searching, there was no problem, but the jaxen. jar package was not used.
Download from http://jaxen.org/
Jaxen is an XPATH engine developed using Java and supports JDOM and dom4j.
The error message is as follows
I encountered a problem when I learned to parse XML using XPath technology today:
Exception in thread "Main" Java. Lang. noclassdeffounderror: ORG/jaxen/basexpathAt java. Lang. Class. forname0 (native method)At java. Lang. Class. forname (unknown source)At org. JDOM. XPath. XPath. newinstance (XPath. Java: 126)At com. Shi. JDOM. XPath. readjdom (XPath. Java: 30)At com. Shi. JDOM. XPath. Main (XPath. Java: 45)
When looking at JDOM, we said that JDO
: Standard resolution (Iterator Iteration)
Code
/** Parse XML in dom4j mode */
Running result:
Resolution 2: Selective resolution (XPath path)
Dom4j + XPath, select only ID resolution,Doc. selectnodes ("// root // person // ID ")
Code
/** Parse XML in dom4j mode (method 2) */
Note:When parsing XML with XPath, You need to import jaxen;This example needs to import the latest jaxen p
layer (adding, modifying, deleting, and querying objects) to the business engine of easyjweb tools. Therefore, for small and medium-sized Java Web applications, you do not need to consider building a DaO layer separately (except for special custom functions ).
Demo:1. Demonstration of separately generated Functions// Single-product tableedit.htmlJava-CP ".. /lib/velocity-1.4.jar ;.. /lib/easydbo0.5.0.jar ;.. /lib/log4j-1.2.13.jar ;.. /lib/dom4j-1.6.1.jar ;.. /lib/commons-beanutils-core1.7.1.jar
code quality, but this is only for the part of the Code actually tested. You need a tool to tell youProgramIn this way, you can write test code for these parts and find more bugs.
Mark doliner's cobertura (CoberturaIn Spanish) is a free GPL tool to complete this task. Cobertura uses additional statements to record which rows are tested and which rows are not tested when a test package is executed. In this way, cobertura measures bytecode to monitor the test. Then it generates an HTML or XML re
Java cultivation path-reading XML files and java cultivation path xml
This time, we will record how to operate xml files in java. In fact, it is easy to get started with python crawler. In java, dom4j has a library similar to lxml in python.
It should be emphasized that when using the dom4j library, it actually has a dependency package, namely jaxen. If this parameter is not added, an error is returned. (The download links of dom4j and
Instance:
1. Create a Maven project simple-weather
C:/> MVN archetype: Create-dgroupid = cn. vicky. maven. ch04-dartifactid = simple-weather-dpackagename = cn. vicky. maven-dversion = 1.0 (overwrite the default 1.0-Snapshot)
2. What we want to do is to add some information about the project license, organization, and project-related developers.
3. Add new dependency
In this project, we will use dom4j and jaxen. In order to format the output of this
DOM4J is an open source XML parsing package produced by dom4j.org. DOM4J is an easy-to-use, open Source Library for Xml,xpath and XSLT. It is applied to the Java platform, with a Java collection framework and full support for Dom,sax and JAXP.
DOM4J Download jar Package: Http://downloads.sourceforge.net/dom4j/dom4j-1.6.1.jar
Jaxen (Support for XPath): Http://dist.codehaus.org/jaxen/distributions/
Note: Some of the comments are read/write files (corresponding to the operation string only), or the replaceable method. In JDOM and dom4j, jaxen. jar is required for xpath.
I. Dom operations
public static void getDoc() throws ParserConfigurationException, SAXException, IOException{DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();DocumentBuilder db = dbf.newDocumentBuilder();//Document doc = db.parse(new File("student.xml"));String xm
using XPath to find the need to introduce Jaxen-xx-xx.jar, otherwise it will report java.lang.noclassdeffounderror:org/jaxen/jaxenexception exception.
List list=document. selectnodes ("/books/book/@show"); XPath Syntax 1, select the node
XPath uses a path expression to select a node in an XML document, and the node is selected along the path or step.
Common Path Expressions:
An expression
, through DOM4J parse the returned XML stream, get the information you want.This example believes that you will have a deeper understanding of the phrase "Webserviice is based on the SOAP protocol", and in the process of using DOM4J to parse the return stream of XML, there are some problems that need to be introduced into the Jaxen-1.1.1.jar package, otherwise the program will report org/ Jaxen/jaxenexcepti
In linuxlinux, when the platform is running in linux, the putty.exe window is closed, and the script runs normally. Originally, when the @ echooff @ title test jar project runs independently, java-Xbootclasspath/:. /lib/commons-logging -... in Linux, how does one allow scripts to run in linuxlinuxin the background? when the putty.exe window is closed, the scripts can still run normally. Originally, @ echo off @ title test jar project runs independently. java-Xbootclasspath/:. /lib/commons-loggin
is a class library used by Java to process JSON format data, with excellent performance.
Jasypt ~ Simple and Easy-to-use String encryption tool.
Jasper ~ Tomcat6.0 version after the lib package location adjustment, jasper-runtime.jar and jasper-compiler-jdt.jar, jasper-compiler.jar and so on are integrated into the jasper. jar package. Compile class. If you want to manually compile JSP, it also includes other JAR packages under tomcat lib: jasper. jars; servlet-api.jar; el-api.jar; catalina. ja
using DOM4J to read and write XML. it is particularly worth mentioning that Sun's JAXM is also using DOM4J. The use of the four methods will be described in detail in Baidu.2. Brief introduction to XPath
XPath is a language used to search for information in XML documents. XPath is used to navigate through elements and attributes in XML documents and traverse elements and attributes. XPath is the main element of W3C XSLT standards, and XQuery and XPointer are also built on XPath expressions. The
When parsing XML using DOM4J, it is a good idea to get the data for a node quickly, and Dom4j's quick manual also suggests thatIn this way,method is to use the selectnodes (String XPath) method of document.selectSingleNode (String XPath)Code notation:listThe following exception was thrown when executing:Exception in thread "main" java.lang.noclassdeffounderror:org/jaxen/jaxenexceptionAt Org.dom4j.DocumentFactory.createXPath (documentfactory.java:230)A
plots, time series, and Gantt charts, in addition, it can generate PNG and JPEG output and be associated with PDF and EXCEL.
Jaxen ~ Jaxen is an open source XPath library written in Java. This is suitable for a variety of different object models, including DOM, XOM, dom4j, and JDOM. It can also be used as an adapter to convert Java byte code or XML Java bean to xml, so that you can use XPath to query thes
use this connection pool, you need this jar package.
Optional
Connector. jar jca api. If you configure hibernate as connector on the app server, you need this jar. However, in fact, the app server will definitely carry this package, which is also a redundant package. Optional
Jboss-system.jar (optional)
Optional when jboss-system.jar uses treecache
Jacc-1_0-fr.jar jacc library optional
Checkstyle-all.jar (optional)
The test unit of JUnit. jar is optional.
Optional; optional
Ant-lanuncher.jar (o
, time series, and Gantt charts, in addition, it can generate PNG and JPEG output and be associated with PDF and excel.
Jaxen ~ Jaxen is an open source XPath library written in Java. This is suitable for a variety of different object models, including Dom, XOM, dom4j, and JDOM. It can also be used as an adapter to convert JAVA byte code or XML Java Bean to XML, so that you can use XPath to query these tree
obtain the desired information.
Through this example, I believe that you will have a deeper understanding of the sentence "webserviice is based on the SOAP protocol". In addition, when using dom4j to parse the XML returned stream, encountered some trouble, need to introduce an additional jaxen-1.1.1.jar package, otherwiseProgramThe error ORG/jaxen/jaxenexception is reported. When XML contains a namespace
optional xerces. Jar SAX Parser JDK earlier than 1.4
Jaxen-1.1-beta-7.jar jaxen use optional if you want to improve Startup Performance
Ant-junit.jar ant JUnit support (optional)
Ant swing support ant-swing.jar
The jar package of the ant. Jar ant compilation tool. Optional.
The proxool. Jar proxool JDBC connection pool is optional.
Concurrent. Jar required to use treecache
Syndiag2.jar is optional.
Commons
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.